<style scoped>
  .menuContainer {
    width: 900px;
    height: 500px;
    border: solid 1px #333;
    overflow: hidden;
    padding: 0px;
    padding-right: 20px;
    margin-right: auto;
    margin-left: auto;
    margin: 0px;
  }

</style>
<style>
.form-box{
    margin-top:50px;
}
  .form-box .el-form-item__label{
      font-size: 25px !important;
      margin:0px !important;
      padding:0px !important;
  }
  .form-box .el-input__inner{
      height: 62px !important;
      line-height:62px!important;
      font-size:20px;
  }
    .form-box .el-input-number{
      height: 60px !important;
      line-height:60px !important;
  }
</style>

<template>
    <!--页面主体，内容区域-->
    <div class="content">
      <div class="body">
        <div class="frame">
            <div class="listArea" style="height:500px !important">
                <div class="form-box" style="width:90%;margin-left:auto;margin-right:auto">

<el-form :label-position="labelPosition"   :model="formLabelAlign">
    <el-form-item label="控温开关">
        <el-radio-group v-model="wConfig.TemperatureControlSwich">
          <el-radio :label="1">开启</el-radio>
          <el-radio :label="0">关闭</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="风机开关">
        <el-radio-group v-model="wConfig.FanControlSwich">
          <el-radio :label="1">开启</el-radio>
          <el-radio :label="0">关闭</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="照明灯开关">
        <el-radio-group v-model="wConfig.LightControlSwich">
          <el-radio :label="1">开启</el-radio>
          <el-radio :label="0">关闭</el-radio>
          <el-radio :label="2">自动</el-radio>
        </el-radio-group>
      </el-form-item>
  <el-form-item label="控温值℃">
    <el-input-number v-model="wConfig.TemperatureSetValue"  style="width:100%"  :step="1" :max="100"></el-input-number>
  </el-form-item>
  <el-form-item>
    <button class="btn btn-primary btn-lg normal-btn" @click="onSubmit" type="button">保存</button>
 </el-form-item>
</el-form>
          <!--<div v-if="isAdmin()=='ok'">
                                <div class="btn-bottom-left" @click="btnUpdateSystemClickEvent">更新系统</div>
                            </div>-->
          <!--<div class="btn-bottom2" @click="btnHelperClickEvent">帮助手册</div>-->
                </div>
            </div>
        </div>
        <button class="btn btn-danger btn-lg btn-bottom-right" @click="btnBackClickEvent" type="button">返回</button>
      </div>
    </div>
</template>
<script>
  export default {
    name: "warningConfig",
    extends: extend,
    data: function () {
      return {
        pageTitle: "控温设定",
        countDownTimerMax: 120,
        infoData: {},
        labelPosition: 'top',
        ClientUseCode:this.$parent.clientInfo.ClientUseCode,
        num9:1,
        wConfig: {
          TemperatureSetValue: 10,
          TemperatureControlSwich:1,
          FanControlSwich:1,
        }
      };
    },
    computed: {

    },
    methods: {
    onSubmit() {
        console.log($('#FilterProductionDate').val(), 9999999999)
        if(this.wConfig.FanControlSwich==0)
        {
          this.wConfig.TemperatureControlSwich=0;
        }
        else if(this.wConfig.TemperatureControlSwich==1)
        {
          this.wConfig.FanControlSwich=1;
        }
        this.$parent.clientInfo.TemperatureControlSwich = this.wConfig.TemperatureControlSwich;
        this.$parent.clientInfo.FanControlSwich = this.wConfig.FanControlSwich;
        this.$parent.clientInfo.TemperatureSetValue = this.wConfig.TemperatureSetValue;
        this.$parent.clientInfo.LightControlSwich = this.wConfig.LightControlSwich;
        // if(!Mobile || !UserRealName || !Sex || ！QQ){
        //     this.$toast.error('请完善表单信息')
        // }

        //console.log(this.$parent.clientInfo, 2134)
        P_Client.setClientInfo(JSON.stringify(this.$parent.clientInfo));
        var settingStr="参数设置：温度设定："+this.wConfig.TemperatureSetValue+"℃；控温："
        +(this.wConfig.TemperatureControlSwich=='1'?'开':'关')
        +"；风机："+(this.wConfig.FanControlSwich=='1'?'开':'关')+
        "；照明灯："+(this.wConfig.LightControlSwich=='1'?'开':'关');
        // 记录用户登录成功日志
        P_User.settingLog(JSON.stringify(this.$parent.currentInfo),settingStr);
       
      },
      setClientInfoCallback: function(obj){
        
        if(obj.status==0){
            this.$toast.info('保存成功！');
        }else{
             this.$toast.error('保存失败, 数据异常');
        }

      },
      // 格式化sqlAcheml时间
      formatSqlTime: function(params){
        if(params){
          console.log(params, 123141234242)
          return params.substring(0,10) + ' ' + params.substring(11,)
        }
      },
    },
    mounted: function () {
      //选择时间和日期
      $(".form-datetime").datetimepicker({
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 3,
        format: "yyyy-mm-dd hh:ii"
      }).on('changeDate', function (ev) {
        that.getVideoList();

      });
      this.wConfig=this.$parent.clientInfo;
      this.wConfig.TemperatureSetValue=parseInt(this.wConfig.TemperatureSetValue);
      this.wConfig.FilterProductionDate = this.formatSqlTime(this.wConfig.FilterProductionDate);
    }
  };

</script>
